package com.ztgf.order.models.service;

import com.baomidou.mybatisplus.service.IService;
import com.ztgf.common.constant.Result;
import com.ztgf.order.models.bo.OrderStatusSaveBO;
import com.ztgf.order.models.dto.OrderInfoDTO;
import com.ztgf.order.models.dto.OrderStatusDTO;
import com.ztgf.shopping.models.dto.shop.ShopSysInvoiceDTO;

import java.util.List;

/**
 * 订单状态表服务
 *
 * @author YUE
 * @Date 2020-06-23 10:33:48
 */
public interface IOrderStatusService extends IService<OrderStatusDTO> {
    Integer getUnfinishedOrderNum(Long shopId,Integer type);

    OrderStatusDTO getByOrderId(Long orderId);

    boolean add(OrderStatusSaveBO saveBO);

    boolean updateOrderStateByProductionState(Long orderId);

    boolean updateOrderDeleteState(Long orderId, int type);

    /**
     * description: 发货完成修改订单状态为待签收
     * param: [id]
     * author: chenyu.wang
     * date: 2020-07-03
     * return: boolean
     */
    void updateOrderShipWay(Long orderId);

    /**
     * description: 订单已签收
     * param: [id]
     * author: chenyu.wang
     * date: 2020-07-03
     * return: boolean
     */
//    boolean updateReceived(Long orderId, Integer orderState);

    /**
     * 订单签收
     * @param orderId
     * @param isCheckToken 是否效验token
     * @return
     */
    Result saveOrderReceive(Long orderId, boolean isCheckToken);
    Result saveOrderReceive(Long orderId, boolean isCheckToken, boolean isFinish);

    List<OrderStatusDTO> getListAuthingOrder(Long lastNo);

    void updateOrderInvoiceState(Long orderId);

    void signAbandonContact(Long orderId, Integer signType);

    List<OrderStatusDTO> getListSignAbandonOrder(Long lastNo);

    Integer getUnfinishedInquiryOrderNum(Long shopId, Integer shopType);

    boolean addByOrderInfo(Long orderId, Long invoiceHeadId);
    boolean updateRightsProtection(Long orderId, int type, int status);
    Result<?> contactSign(Long orderId, int type);

    /**
     * 同步技术服务费（买家申请平台砍价成功）
     * @return
     */
    List<ShopSysInvoiceDTO> getSynchronizationShopSysInvoiceBuy();
}
